<?php

namespace app\exam\validate\admin;

use think\Validate;

/**
 * 题库验证类
 * @package app\exam\validate\admin
 */
class QuestionBank extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id'               => 'require',
        'title'            => 'require',
        'fullcategorypath' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id'               => '操作出错',
        'title'            => '请填写题库名称',
        'fullcategorypath' => '请选择分类',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'create' => ['title', 'fullcategorypath'],
        'edit'   => ['id', 'title', 'fullcategorypath']
    ];
}
